<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="page" uri="http://www.yf1701.com/tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<script src="js/jquery.min.js" type="text/javascript"></script>
<link href="css/zhu/bootstrap.min.css" rel="stylesheet">
<script src="js/bootstrap.min.js" type="text/javascript"></script>
<link href="css/zhu/Administrators.css" rel="stylesheet">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript">
	
</script>
<title>权限管理</title>
</head>
<body>
	<c:set var="isDoing" value="0" />
	<c:forEach items="${powerList}" var="power" varStatus="status">

		<c:if test="${power.name=='权限管理' && isDoing==0}" var="u">
			<!--  设置跳出 条件 -->
			<c:set var="isDoing" value="1" />
			<div class="right">
				<div class="right-a">
					<span>权限管理 </span>
				</div>
				<div class="right-b">
					<ul>
						<li>
							<button type="button" class="btn btn-primary" data-toggle="modal"
								data-target="#myModal7">添加</button>
							<div class="modal fade" id="myModal7" tabindex="-1" role="dialog"
								aria-labelledby="myModalLabel">
								<div class="modal-dialog">
									<div class="modal-content">
										<div class="modal-header">
											<button data-dismiss="modal" class="close" type="button">
												<span aria-hidden="true">×</span><span class="sr-only">Close</span>
											</button>
											<h4 class="modal-title">添加</h4>
										</div>
										<div class="modal-body">
											<form action="/fuhe/addadmin" class="admin_form"
												method="post" style="padding-left: 85px">
												<input type="hidden" value="" />
												<table border="0" cellspacing="0" cellpadding="0">
													<tbody>
														<tr>
															<td>名称：</td>
															<td><input name="powername" type="text">
																<div class="phone_tips">
																	<span style="color: red"></span>
																</div></td>
														</tr>
														<tr>
															<td>uri</td>
															<td><input name="poweruri" type="text">
																<div class="pwd2_tips">
																	<span style="color: red"></span>
																</div></td>
														</tr>
														<tr>
															<td>父权限</td>
															<td><select name="role">
																	<option value="">--请选择--</option>
																	<c:forEach items="${pagep.data}" var="power">
																		<option value="${power.id}">${power.name}</option>
																	</c:forEach>

															</select>
																<div class="pwd3_tips">
																	<span style="color: red"></span>
																</div></td>
														</tr>
													</tbody>
												</table>
											</form>
										</div>
										<div class="modal-footer">
											<button data-dismiss="modal" class="btn btn-default"
												type="button">关闭</button>
											<button class="btn btn-primary powerbtn" 
												type="button">提交</button>
										</div>
									</div>
									<!-- /.modal-content -->
								</div>
								<!-- /.modal-dialog -->
							</div>

						</li>
					</ul>
					<div>
						<table width="100%" border="0" cellspacing="0" cellpadding="0"
							class="tablelist table table-striped table-bordered table-hover  table-condensed">
							<thead>
								<th width="20%">名称</th>
								<th width="20%">资源uri</th>
								<th width="30%">状态</th>
								<th width="30%">操作</th>
							</thead>
							<tbody>
								<c:forEach items="${pagep.data}" var="power">
									<tr>
										<td>${power.name}</td>
										<td>${power.uri}</td>
										<td><c:if test="${power.iswas ==1 }" var="u">
												可用
											</c:if> <c:if test="${!u }">
												禁用
											</c:if></td>
										<td><button dongzuo="xiugai" type="button"
												class="btn btn-primary" data-toggle="modal"
												data-target="#myModalxiugai${ad.id}" onclick="editInfo(obj)">修改</button>
											<!-- 修改弹出表格 -->
											<button type="button" class="btn btn-danger"
												adminshanchu="${ad.id}">删除</button></td>
									</tr>
								</c:forEach>
							</tbody>
						</table>
						<page:page pages="${pagep.pages}" url="powerpage" total="${pagep.total}"
						pagesize="${pagep.pagesize}" currpage="${pagep.currpage}"/>
					</div>
				</div>
			</div>
		</c:if>
		<c:if test="${fn:length(powerList) == status.count && isDoing==0 }">
			<c:if test="${!u }">
				<jsp:include page="403.jsp"></jsp:include>
			</c:if>
		</c:if>
	</c:forEach>
</body>
</html>